﻿// This software is the confidential and proprietary information of NetBay.
// Such confidential information should not be disclosed.
// NetBay copyright(c) 2012

#region

using System.Collections.Generic;
using System.Runtime.Serialization;

#endregion

namespace Rio.Workflow.Runtime
{
    /// <summary>
    /// StartWorkflow Creation context
    /// </summary>
    [DataContract]
    public class CreationContext
    {
        #region Constructors

        /// <summary>
        /// Initializes a new instance of the <see cref="CreationContext" /> class.
        /// </summary>
        public CreationContext()
        {
        }

        /// <summary>
        /// Initializes a new instance of the <see cref="CreationContext"/> class.
        /// </summary>
        /// <param name="FolderTypeIdentifier">The folder type identifier.</param>
        /// <param name="FolderIdentifier">The folder identifier.</param>
        /// <param name="DocumentsIdentifier">The documents identifier.</param>
        /// <param name="startingCondition">The starting condition.</param>
        /// <param name="UserId">The user id.</param>
        /// <param name="IndexValues">The index values.</param>
        public CreationContext(long FolderTypeIdentifier, long FolderIdentifier, List<long> DocumentsIdentifier,
                               long startingCondition, long UserId, Dictionary<long, string> IndexValues)
        {
            this.FolderTypeIdentifier = FolderTypeIdentifier;
            this.FolderIdentifier = FolderIdentifier;
            this.DocumentsIdentifier = DocumentsIdentifier;
            StartingCondition = startingCondition;
            this.UserId = UserId;
            this.IndexValues = IndexValues;
        }

        /// <summary>
        /// Initializes a new instance of the <see cref="CreationContext"/> class.
        /// </summary>
        /// <param name="FolderTypeIdentifier">The folder type identifier.</param>
        /// <param name="FolderIdentifier">The folder identifier.</param>
        /// <param name="DocumentsIdentifier">The documents identifier.</param>
        /// <param name="startingCondition">The starting condition.</param>
        /// <param name="UserId">The user id.</param>
        /// <param name="ChronoId">The chrono id.</param>
        /// <param name="IndexValues">The index values.</param>
        public CreationContext(long FolderTypeIdentifier, long FolderIdentifier, List<long> DocumentsIdentifier,
                               long startingCondition, long UserId, long ChronoId, Dictionary<long, string> IndexValues)
            : this(FolderTypeIdentifier, FolderIdentifier, DocumentsIdentifier, startingCondition, UserId, IndexValues)
        {
            this.ChronoId = ChronoId;
        }

        #endregion

        #region Instance Properties

        /// <summary>
        /// Gets or sets the chrono id.
        /// </summary>
        /// <value>The chrono id.</value>
        [DataMember]
        public long? ChronoId { get; set; }

        /// <summary>
        /// Gets or sets the custom user data.
        /// </summary>
        /// <value>
        /// The custom user data.
        /// </value>
        public object CustomUserData { get; set; }

        /// <summary>
        /// Gets or sets the documents identifier.
        /// </summary>
        /// <value>The documents identifier.</value>
        [DataMember]
        public List<long> DocumentsIdentifier { get; set; }

        /// <summary>
        /// Gets or sets the folder identifier.
        /// </summary>
        /// <value>The folder identifier.</value>
        [DataMember]
        public long FolderIdentifier { get; set; }

        /// <summary>
        /// Gets or sets the folder type identifier.
        /// </summary>
        /// <value>The folder type identifier.</value>
        [DataMember]
        public long FolderTypeIdentifier { get; set; }

        /// <summary>
        /// Gets or sets the index values.
        /// </summary>
        /// <value>The index values.</value>
        [DataMember]
        public Dictionary<long, string> IndexValues { get; set; }

        /// <summary>
        /// Gets or sets the groups identifier.
        /// </summary>
        /// <value>The groups identifier.</value>
        [DataMember]
        public List<long> ReceiverGroupId { get; set; }

        /// <summary>
        /// Gets or sets the starting condition.
        /// </summary>
        /// <value>The starting condition.</value>
        [DataMember]
        public long StartingCondition { get; set; }

        /// <summary>
        /// Gets or sets the user id.
        /// </summary>
        /// <value>The user id.</value>
        [DataMember]
        public long UserId { get; set; }

        /// <summary>
        /// Gets or sets the parent instance id.
        /// </summary>
        /// <value>The parent instance id.</value>
        internal long? ParentInstanceId { get; set; }

        #endregion

        #region Instance Methods

        /// <summary>
        /// Returns a <see cref="T:System.String" /> that represents the current
        /// <see cref="T:System.Object" />.
        /// </summary>
        /// <returns>
        /// A <see cref="T:System.String" /> that represents the current <see cref="T:System.Object" />.
        /// </returns>
        public override string ToString()
        {
            return
                string.Format(
                    "FolderTypeIdentifier: {0}, FolderIdentifier: {1}, StartingCondition: {2}, UserId: {3}, ChronoId: {4}, DocumentsIdentifier: {5}, ParentInstanceId: {6}",
                    FolderTypeIdentifier, FolderIdentifier, StartingCondition, UserId, ChronoId, DocumentsIdentifier,
                    ParentInstanceId);
        }

        #endregion
    }
}